package com.example.monitor.model.DTO;

import com.example.monitor.model.enums.AlarmStatus;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;

@Data
public class AlarmQueryDTO {
    @Size(max = 50, message = "报警类型长度不能超过50字符")
    private String alarmType;

    @Size(max = 50, message = "车间名称长度不能超过50字符")
    private String workshop;

    @Size(max = 10, message = "状态长度不能超过10字符")
    private AlarmStatus status; // 可以接收"未处理"、"处理中"、"已解决"

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    @Min(value = 1, message = "页码最小为1")
    private Integer page = 1;

    @Min(value = 1, message = "每页数量最小为1")
    @Max(value = 100, message = "每页数量最大为100")
    private Integer pageSize = 10;
}

